package com.xwaf.platform.system.auth.serviceimpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.plugins.Page;
import com.xwaf.platform.common.service.service.CrudService;
import com.xwaf.platform.system.api.entity.auth.Company;
import com.xwaf.platform.system.api.service.auth.CompanyService;
import com.xwaf.platform.system.auth.dao.CompanyDao;

/**
 * 
 * <p>
 * 企业信息表
 * <p>
 * 
 * @author 李聪 <br>
 * @email xwaf_love@yeah.net <br>
 * @since JDK 1.8<br>
 * @date 2019-5-25 12:22:31 <br>
 * @see 无<br>
 *      Copyright (c) 2019, xwaf_love@yeah.net All Rights Reserved.<br>
 */
@Transactional(readOnly = true)
@Service("companyService")
public class CompanyServiceImpl extends CrudService<CompanyDao, Company> implements CompanyService {

	@Autowired
	private CompanyDao companyDao;

	@Override
	public Page<Company> selPageList(Page<Company> page, Company company) {
		List<Company> list = companyDao.selPageList(page, company);
		page.setRecords(list);
		return page;
	}

	@Override
	public Company findByOne(String companyId) {
		logger.info("findByOne companyId: " + companyId);
		return companyDao.selectById(companyId);
	}

	@Override
	public Company selectLimit() {
		try {
			logger.info("开始睡觉");
			Thread.sleep(10000);
			logger.info("您已经省啦");
			return companyDao.selectById("230");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	@Override
	public Company selectLimitMax() {
		return companyDao.selectById("230");
	}
}
